const express = require('express');

// 创建express应用
const app = express();

// 访问图片 http://localhost:3000/img/1.jpg
app.use('/img', express.static('public'));
app.all('/img/*', (req, res) => {
  res.send('无此图片');
})

// 打开网站 http://localhost:3000/api/recycle/
app.use('/api/recycle',require('./router/recycle'));

app.all('*', (req, res) => {
  res.send('欢迎来到我的后台');
})

app.listen(3000, () => {
  console.log('Server is running on port 3000');
})